package com.zhangfei.function;

import java.util.function.Consumer;

public class ConsumerTest {
    private static void consumer(String something, Consumer<String> consumer) {
        consumer.accept(something);
    }

    private static void doubleconsumer(String something, Consumer<String> consumer1, Consumer<String> consumer2) {
        consumer1.andThen(consumer2).accept(something);
    }

    public static void main(String[] args) {
        //lambda表达式
        consumer("麻黄", something -> {
                    System.out.println(something + "汤一碗");
                }

        );

        //lambda表达式
        doubleconsumer("麻黄", something -> System.out.print("华佗用" + something + "开出："),
                something -> System.out.println(something + "汤一碗"));

    }
}
